home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2006 May / PCpro_2006_05.ISO / files / mobile / fma-2.0-stable-setup.exe / {app} / source / uInputQuery.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2004-10-15  |  1.2 KB  |  61 lines

  1. unit uInputQuery;
  2.  
  3. {
  4. *******************************************************************************
  5. * Descriptions: InputQuery with Unicode support
  6. * $Source: /cvsroot/fma/fma/uInputQuery.pas,v $
  7. * $Locker:  $
  8. *
  9. * Todo:
  10. *
  11. * Change Log:
  12. * $Log: uInputQuery.pas,v $
  13. * Revision 1.1.2.1  2004/10/15 11:29:22  z_stoichev
  14. * Initial checkin.
  15. *
  16. *
  17. }
  18.  
  19. interface
  20.  
  21. uses
  22.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  23.   Dialogs, StdCtrls, TntStdCtrls;
  24.  
  25. type
  26.   TfrmInputQuery = class(TForm)
  27.     TntLabel1: TTntLabel;
  28.     TntEdit1: TTntEdit;
  29.     Button1: TButton;
  30.     Button2: TButton;
  31.   private
  32.     { Private declarations }
  33.   public
  34.     { Public declarations }
  35.   end;
  36.  
  37. var
  38.   frmInputQuery: TfrmInputQuery;
  39.  
  40. function WideInputQuery(ACaption,ATitle: WideString; var DefaultText: WideString): boolean;
  41.  
  42. implementation
  43.  
  44. {$R *.dfm}
  45.  
  46. function WideInputQuery(ACaption,ATitle: WideString; var DefaultText: WideString): boolean;
  47. begin
  48.   with TfrmInputQuery.Create(nil) do
  49.   try
  50.     Caption := ACaption;
  51.     TntLabel1.Caption := ATitle;
  52.     TntEdit1.Text := DefaultText;
  53.     Result := ShowModal = mrOk;
  54.     if Result then DefaultText := TntEdit1.Text;
  55.   finally
  56.     Free;
  57.   end;
  58. end;
  59.  
  60. end.
  61.